<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1" /> 
    <title>支付样例-订单查询</title>
</head>
<?php
ini_set('date.timezone','Asia/Shanghai');
error_reporting(E_ERROR);
require_once "../lib/Pay.Api.php";



function printf_info($data)
{
    foreach($data as $key=>$value){
        echo "<font color='#f00;'>$key</font> : $value <br/>";
    }
}


if(isset($_REQUEST["orderId"]) && $_REQUEST["orderId"] != ""){
	$orderId = $_REQUEST["orderId"];
	$input = new UnifiedData();

	$input->SetParam("orderId", $orderId);
    $input->SetParam("tranDate", date("Ymd"));
    $input->SetParam("tranCode", TranCode::$TRAN_CODE_ORDER_QUERY);
	$result = PayApi::unifiedRequest($input);
	$result["REP_BODY"]["rspmsg"] = urldecode($result["REP_BODY"]["rspmsg"]);
	var_dump($result);
	
	printf_info($result["REP_BODY"]);
	exit();
}

?>
<body>  
	<form action="#" method="post">
        <div style="margin-left:2%;color:#f00">只能查询当天订单记录：</div><br/>
        <div style="margin-left:2%;">商户订单号：</div><br/>
        <input type="text" style="width:96%;height:35px;margin-left:2%;" name="orderId" /><br /><br />
		<div align="center">
			<input type="submit" value="查询" style="width:210px; height:50px; border-radius: 15px;background-color:#FE6714; border:0px #FE6714 solid; cursor: pointer;  color:white;  font-size:16px;" type="button" onclick="callpay()" />
		</div>
	</form>
</body>
</html>